#ifndef OUTLINER_H
#define OUTLINER_H

#include <QAbstractItemModel>
#include <QTreeWidgetItem>

class Scene;
class Object;
class Light;
class Camera;

namespace Ui {
    class Outliner;
}

//class PrimitiveItem;


class Outliner : public QWidget
{
    Q_OBJECT

public:
    explicit Outliner(QWidget *parent = 0);
    ~Outliner();

signals:
    void updated();
    void objectSelected(Object* object);
    void lightSelected(Light* light);
    void noSelection();

public slots:
    void setScene(Scene*);

    void addObject(Object *);
    void removeObject(Object *);

    void addLight(Light* light);
    void removeLight(Light* light);

protected slots:
    void resizeEvent(QResizeEvent *);

private slots:
    void onItemClicked(QTreeWidgetItem*, int);
    void onSelectionChanged();
    void onItemChanged(QTreeWidgetItem*, int);

private:
    Ui::Outliner *ui;
    QTreeWidgetItem* objectsItem;
    QTreeWidgetItem* lightsItem;
    QTreeWidgetItem* cameraItem;

    Scene* m_scene;

//    QHash<Primitive*, PrimitiveItem*> hash;
};

//Q_DECLARE_METATYPE(Primitive*)

#endif // OUTLINER_H
